<template>
  <a-form-model
    style="color: #000"
    layout="horizontal"
    label-align="left"
    :labelCol="{
      span: 2,
    }"
    :wrapperCol="{
      span: 20,
    }"
  >
    <div class="form-title">文件实时防护</div>
    <a-checkbox v-model="form.on" style="margin: 10px 0 0 20px"
      >开启文件实时防护</a-checkbox
    >
    <div style="padding-left: 40px" v-if="form.on">
      <a-form-item label="防护级别：">
        <a-radio-group v-model="form.file">
          <a-radio :style="radioStyle" :value="0">
            高<span class="tip" style="margin-left: 10px"
              >监控文件的所有操作方式，对电脑性能有一定的影响</span
            >
          </a-radio>
          <a-radio :style="radioStyle" :value="1">
            中<span class="tip" style="margin-left: 10px"
              >监控文件的执行、写入，确保病毒无法入侵及运行，极少影响电脑性能</span
            ></a-radio
          >
          <a-radio :style="radioStyle" :value="2">
            低<span class="tip" style="margin-left: 10px"
              >监控文件的执行，确保病毒无法运行，不影响电脑性能</span
            >
          </a-radio>
        </a-radio-group>
      </a-form-item>
      <a-form-item label="文件类型：">
        <a-checkbox-group v-model="form.scanEngine">
          <a-checkbox value="1">文档文件</a-checkbox>
          <a-checkbox value="2">脚本文件</a-checkbox>
          <a-checkbox value="3">可执行文件</a-checkbox>
          <a-checkbox value="4">压缩文档</a-checkbox>
        </a-checkbox-group>
      </a-form-item>
      <a-form-item label="扫描文件：">
        <div class="u-flex u-align-center">
          <span>扫描过程自动跳过大于</span>
          <a-input-number
            v-model="form.logStoreTime"
            class="line-30 mv-6"
            style="width: 100px"
          ></a-input-number>
          <span>M文件</span>
        </div>
        <div class="u-flex u-align-center" style="margin-top: 10px">
          <span>最大扫描</span>
          <a-input-number
            v-model="form.zip"
            class="line-30 mv-6"
            style="width: 60px"
          ></a-input-number>
          <span>层压缩包</span>
        </div>
      </a-form-item>
      <a-form-item label="扫描引擎：">
        <span class="tips">
          启用更多引擎，可提高病毒检出率，但同时会加大对系统性能的影响
        </span>
        <div>
          <a-checkbox-group v-model="form.scanEngine">
            <a-checkbox disabled value="1">SAVE人工智能引擎</a-checkbox>
            <a-checkbox value="2">基因特征引擎</a-checkbox>
            <a-checkbox disabled value="3">云查引擎</a-checkbox>
          </a-checkbox-group>
        </div>
      </a-form-item>
      <a-form-item label="发现恶意文件：" class="file-item">
        <a-radio-group v-model="form.file">
          <a-radio
            :style="{
              ...radioStyle,
              height: '90px',
            }"
            :value="0"
          >
            <span>仅上报，不处理</span>
            <div
              class="tip"
              style="margin-left: 23px; width: 660px; white-space: normal"
            >
              根据病毒的类型和威胁程度，按系统预定义的处置方式对威胁文件进行自动修复或隔离，处置后您可在隔离区进行恢复。随着病毒攻击方式的不断变化，产品将持续更新和增强此模式抵御和处置威胁的能力
            </div></a-radio
          >
          <a-radio :style="radioStyle" :value="1">严格处置</a-radio>
          <a-radio :style="radioStyle" :value="2"> 仅上报，不处理 </a-radio>
        </a-radio-group>
      </a-form-item>
      <div class="flex" style="margin-top: 20px; width: 556px">
        <u-button class="btn-default btn-confirm" @click="confirm">
          确定
        </u-button>
      </div>
    </div>
    <div
      class="flex"
      style="margin-top: 20px; padding-left: 20px; width: 556px"
      v-if="!form.on"
    >
      <u-button class="btn-default btn-confirm" @click="confirm">
        确定
      </u-button>
    </div>
  </a-form-model>
</template>
<script>
export default {
  data() {
    return {
      form: {
        on: true,
        scanEngine: ["1", "3"],
        logStoreTime: 80,
        file: 0,
        zip: 3,
      },
      radioStyle: {
        display: "block",
        lineHeight: "30px",
      },
    };
  },
  mounted() {
    this.getConfig();
  },
  methods: {
    getConfig() {},
    confirm() {
      this.$message.success("配置成功");
    },
  },
};
</script>
<style lang="scss" scoped>
.point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
::v-deep .ant-input-number-input {
  text-align: center;
}
.line-30 {
  line-height: 30px;
  height: 30px;
}
.lable {
  font-weight: bold;
  color: rgba(0, 0, 0, 0.85);
}

.mv-6 {
  margin: 0 6px;
}

.form-title {
  margin-top: 20px;
  padding-left: 20px;
  position: relative;
  font-size: 20px;
  font-weight: bold;

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: #6398e5;
  }
}

.tip {
  color: #999;
}
.file-item :deep .ant-form-item-control {
  height: 120px;
}
</style>
